package com.yugao.fintech.draper.security.config;

import com.yugao.fintech.draper.auth.api.AuthFeignApi;
import com.yugao.fintech.draper.auth.api.UserFeignApi;
import com.yugao.fintech.draper.security.service.impl.SecurityUserDetailServiceImpl;
import com.yugao.fintech.draper.security.service.impl.SecurityUserManager;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;

@AutoConfiguration
public class UserDetailServiceAutoConfigure {

	@Bean
	public SecurityUserManager securityUserManager(UserFeignApi userService, AuthFeignApi menuService) {
		return new SecurityUserManager(userService, menuService);
	}

	@Bean
	public SecurityUserDetailServiceImpl securityUserDetailService(SecurityUserManager securityUserManager) {
		return new SecurityUserDetailServiceImpl(securityUserManager);
	}
}
